package com.autonavi.yunda.yunji.core.vo.response;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

/**
 * @author sunzhenbang
 */
@Data
@NoArgsConstructor
public class PageVO<T> {
    private List<T> list;
    private Long total;

    public PageVO(List<T> list, Long total) {
        this.list = list;
        this.total = total;
    }

    public static <P> PageVO<P> empty() {
        PageVO<P> pageVO = new PageVO<>();
        pageVO.list = new ArrayList<>();
        pageVO.total = 0L;
        return pageVO;
    }
}
